#!/usr/bin/python3.5

# -*- coding: utf-8 -*-


def selectionSort(arr):
    for i in range(len(arr)):
        max_num = i
        for j in range(i+1,len(arr)):
            if arr[j]< arr[max_num]:
                max_num = j
        arr[i], arr[max_num] = arr[max_num], arr[i]
    return arr





if __name__ =="__main__":

    a = [2, 8, 4, 5, 9, 4, 42, 0, 3, 6, 8]
    print(selectionSort(a))